home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / docs / gdb / gdb.i7 < prev    next >
Encoding:
GNU Info File  |  1994-07-26  |  48.4 KB  |  1,309 lines

  1. This is Info file ./gdb.info, produced by Makeinfo-1.52 from the input
  2. file gdb.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Gdb::                         The GNU debugger.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the GNU debugger GDB.
  8.  
  9.    This is Edition 4.12, January 1994, of `Debugging with GDB: the GNU
  10. Source-Level Debugger' for GDB Version 4.12.
  11.  
  12.    Copyright (C) 1988, '89, '90, '91, '92, '93 Free Software
  13. Foundation, Inc.
  14.  
  15.    Permission is granted to make and distribute verbatim copies of this
  16. manual provided the copyright notice and this permission notice are
  17. preserved on all copies.
  18.  
  19.    Permission is granted to copy and distribute modified versions of
  20. this manual under the conditions for verbatim copying, provided also
  21. that the entire resulting derived work is distributed under the terms
  22. of a permission notice identical to this one.
  23.  
  24.    Permission is granted to copy and distribute translations of this
  25. manual into another language, under the above conditions for modified
  26. versions.
  27.  
  28. 
  29. File: gdb.info,  Node: Hooks,  Next: Command Files,  Prev: Define,  Up: Sequences
  30.  
  31. User-defined command hooks
  32. ==========================
  33.  
  34.    You may define *hooks*, which are a special kind of user-defined
  35. command.  Whenever you run the command `foo', if the user-defined
  36. command `hook-foo' exists, it is executed (with no arguments) before
  37. that command.
  38.  
  39.    In addition, a pseudo-command, `stop' exists.  Defining
  40. (`hook-stop') makes the associated commands execute every time
  41. execution stops in your program: before breakpoint commands are run,
  42. displays are printed, or the stack frame is printed.
  43.  
  44.    For example, to ignore `SIGALRM' signals while single-stepping, but
  45. treat them normally during normal execution, you could define:
  46.  
  47.      define hook-stop
  48.      handle SIGALRM nopass
  49.      end
  50.      
  51.      define hook-run
  52.      handle SIGALRM pass
  53.      end
  54.      
  55.      define hook-continue
  56.      handle SIGLARM pass
  57.      end
  58.  
  59.    You can define a hook for any single-word command in GDB, but not
  60. for command aliases; you should define a hook for the basic command
  61. name, e.g.  `backtrace' rather than `bt'.  If an error occurs during
  62. the execution of your hook, execution of GDB commands stops and GDB
  63. issues a prompt (before the command that you actually typed had a
  64. chance to run).
  65.  
  66.    If you try to define a hook which does not match any known command,
  67. you get a warning from the `define' command.
  68.  
  69. 
  70. File: gdb.info,  Node: Command Files,  Next: Output,  Prev: Hooks,  Up: Sequences
  71.  
  72. Command files
  73. =============
  74.  
  75.    A command file for GDB is a file of lines that are GDB commands.
  76. Comments (lines starting with `#') may also be included.  An empty line
  77. in a command file does nothing; it does not mean to repeat the last
  78. command, as it would from the terminal.
  79.  
  80.    When you start GDB, it automatically executes commands from its
  81. "init files".  These are files named `.gdbinit'.  GDB reads the init
  82. file (if any) in your home directory, then processes command line
  83. options and operands, and then reads the init file (if any) in the
  84. current working directory.  This is so the init file in your home
  85. directory can set options (such as `set complaints') which affect the
  86. processing of the command line options and operands.  The init files
  87. are not executed if you use the `-nx' option; *note Choosing modes:
  88. Mode Options..
  89.  
  90.    On some configurations of GDB, the init file is known by a different
  91. name (these are typically environments where a specialized form of GDB
  92. may need to coexist with other forms, hence a different name for the
  93. specialized version's init file).  These are the environments with
  94. special init file names:
  95.  
  96.    * VxWorks (Wind River Systems real-time OS): `.vxgdbinit'
  97.  
  98.    * OS68K (Enea Data Systems real-time OS): `.os68gdbinit'
  99.  
  100.    * ES-1800 (Ericsson Telecom AB M68000 emulator): `.esgdbinit'
  101.  
  102.    You can also request the execution of a command file with the
  103. `source' command:
  104.  
  105. `source FILENAME'
  106.      Execute the command file FILENAME.
  107.  
  108.    The lines in a command file are executed sequentially.  They are not
  109. printed as they are executed.  An error in any command terminates
  110. execution of the command file.
  111.  
  112.    Commands that would ask for confirmation if used interactively
  113. proceed without asking when used in a command file.  Many GDB commands
  114. that normally print messages to say what they are doing omit the
  115. messages when called from command files.
  116.  
  117. 
  118. File: gdb.info,  Node: Output,  Prev: Command Files,  Up: Sequences
  119.  
  120. Commands for controlled output
  121. ==============================
  122.  
  123.    During the execution of a command file or a user-defined command,
  124. normal GDB output is suppressed; the only output that appears is what is
  125. explicitly printed by the commands in the definition.  This section
  126. describes three commands useful for generating exactly the output you
  127. want.
  128.  
  129. `echo TEXT'
  130.      Print TEXT.  Nonprinting characters can be included in TEXT using
  131.      C escape sequences, such as `\n' to print a newline.  *No newline
  132.      is printed unless you specify one.* In addition to the standard C
  133.      escape sequences, a backslash followed by a space stands for a
  134.      space.  This is useful for displaying a string with spaces at the
  135.      beginning or the end, since leading and trailing spaces are
  136.      otherwise trimmed from all arguments.  To print ` and foo = ', use
  137.      the command `echo \ and foo = \ '.
  138.  
  139.      A backslash at the end of TEXT can be used, as in C, to continue
  140.      the command onto subsequent lines.  For example,
  141.  
  142.           echo This is some text\n\
  143.           which is continued\n\
  144.           onto several lines.\n
  145.  
  146.      produces the same output as
  147.  
  148.           echo This is some text\n
  149.           echo which is continued\n
  150.           echo onto several lines.\n
  151.  
  152. `output EXPRESSION'
  153.      Print the value of EXPRESSION and nothing but that value: no
  154.      newlines, no `$NN = '.  The value is not entered in the value
  155.      history either.  *Note Expressions: Expressions, for more
  156.      information on expressions.
  157.  
  158. `output/FMT EXPRESSION'
  159.      Print the value of EXPRESSION in format FMT.  You can use the same
  160.      formats as for `print'.  *Note Output formats: Output Formats, for
  161.      more information.
  162.  
  163. `printf STRING, EXPRESSIONS...'
  164.      Print the values of the EXPRESSIONS under the control of STRING.
  165.      The EXPRESSIONS are separated by commas and may be either numbers
  166.      or pointers.  Their values are printed as specified by STRING,
  167.      exactly as if your program were to execute the C subroutine
  168.  
  169.           printf (STRING, EXPRESSIONS...);
  170.  
  171.      For example, you can print two values in hex like this:
  172.  
  173.           printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
  174.  
  175.      The only backslash-escape sequences that you can use in the format
  176.      string are the simple ones that consist of backslash followed by a
  177.      letter.
  178.  
  179. 
  180. File: gdb.info,  Node: Emacs,  Next: GDB Bugs,  Prev: Sequences,  Up: Top
  181.  
  182. Using GDB under GNU Emacs
  183. *************************
  184.  
  185.    A special interface allows you to use GNU Emacs to view (and edit)
  186. the source files for the program you are debugging with GDB.
  187.  
  188.    To use this interface, use the command `M-x gdb' in Emacs.  Give the
  189. executable file you want to debug as an argument.  This command starts
  190. GDB as a subprocess of Emacs, with input and output through a newly
  191. created Emacs buffer.
  192.  
  193.    Using GDB under Emacs is just like using GDB normally except for two
  194. things:
  195.  
  196.    * All "terminal" input and output goes through the Emacs buffer.
  197.  
  198.    This applies both to GDB commands and their output, and to the input
  199. and output done by the program you are debugging.
  200.  
  201.    This is useful because it means that you can copy the text of
  202. previous commands and input them again; you can even use parts of the
  203. output in this way.
  204.  
  205.    All the facilities of Emacs' Shell mode are available for interacting
  206. with your program.  In particular, you can send signals the usual
  207. way--for example, `C-c C-c' for an interrupt, `C-c C-z' for a stop.
  208.  
  209.    * GDB displays source code through Emacs.
  210.  
  211.    Each time GDB displays a stack frame, Emacs automatically finds the
  212. source file for that frame and puts an arrow (`=>') at the left margin
  213. of the current line.  Emacs uses a separate buffer for source display,
  214. and splits the screen to show both your GDB session and the source.
  215.  
  216.    Explicit GDB `list' or search commands still produce output as
  217. usual, but you probably have no reason to use them from Emacs.
  218.  
  219.      *Warning:* If the directory where your program resides is not your
  220.      current directory, it can be easy to confuse Emacs about the
  221.      location of the source files, in which case the auxiliary display
  222.      buffer does not appear to show your source.  GDB can find programs
  223.      by searching your environment's `PATH' variable, so the GDB input
  224.      and output session proceeds normally; but Emacs does not get
  225.      enough information back from GDB to locate the source files in
  226.      this situation.  To avoid this problem, either start GDB mode from
  227.      the directory where your program resides, or specify a full path
  228.      name when prompted for the `M-x gdb' argument.
  229.  
  230.      A similar confusion can result if you use the GDB `file' command to
  231.      switch to debugging a program in some other location, from an
  232.      existing GDB buffer in Emacs.
  233.  
  234.    By default, `M-x gdb' calls the program called `gdb'.  If you need
  235. to call GDB by a different name (for example, if you keep several
  236. configurations around, with different names) you can set the Emacs
  237. variable `gdb-command-name'; for example,
  238.  
  239.      (setq gdb-command-name "mygdb")
  240.  
  241. (preceded by `ESC ESC', or typed in the `*scratch*' buffer, or in your
  242. `.emacs' file) makes Emacs call the program named "`mygdb'" instead.
  243.  
  244.    In the GDB I/O buffer, you can use these special Emacs commands in
  245. addition to the standard Shell mode commands:
  246.  
  247. `C-h m'
  248.      Describe the features of Emacs' GDB Mode.
  249.  
  250. `M-s'
  251.      Execute to another source line, like the GDB `step' command; also
  252.      update the display window to show the current file and location.
  253.  
  254. `M-n'
  255.      Execute to next source line in this function, skipping all function
  256.      calls, like the GDB `next' command.  Then update the display window
  257.      to show the current file and location.
  258.  
  259. `M-i'
  260.      Execute one instruction, like the GDB `stepi' command; update
  261.      display window accordingly.
  262.  
  263. `M-x gdb-nexti'
  264.      Execute to next instruction, using the GDB `nexti' command; update
  265.      display window accordingly.
  266.  
  267. `C-c C-f'
  268.      Execute until exit from the selected stack frame, like the GDB
  269.      `finish' command.
  270.  
  271. `M-c'
  272.      Continue execution of your program, like the GDB `continue'
  273.      command.
  274.  
  275.      *Warning:* In Emacs v19, this command is `C-c C-p'.
  276.  
  277. `M-u'
  278.      Go up the number of frames indicated by the numeric argument
  279.      (*note Numeric Arguments: (emacs)Arguments.), like the GDB `up'
  280.      command.
  281.  
  282.      *Warning:* In Emacs v19, this command is `C-c C-u'.
  283.  
  284. `M-d'
  285.      Go down the number of frames indicated by the numeric argument,
  286.      like the GDB `down' command.
  287.  
  288.      *Warning:* In Emacs v19, this command is `C-c C-d'.
  289.  
  290. `C-x &'
  291.      Read the number where the cursor is positioned, and insert it at
  292.      the end of the GDB I/O buffer.  For example, if you wish to
  293.      disassemble code around an address that was displayed earlier,
  294.      type `disassemble'; then move the cursor to the address display,
  295.      and pick up the argument for `disassemble' by typing `C-x &'.
  296.  
  297.      You can customize this further by defining elements of the list
  298.      `gdb-print-command'; once it is defined, you can format or
  299.      otherwise process numbers picked up by `C-x &' before they are
  300.      inserted.  A numeric argument to `C-x &' indicates that you wish
  301.      special formatting, and also acts as an index to pick an element
  302.      of the list.  If the list element is a string, the number to be
  303.      inserted is formatted using the Emacs function `format'; otherwise
  304.      the number is passed as an argument to the corresponding list
  305.      element.
  306.  
  307.    In any source file, the Emacs command `C-x SPC' (`gdb-break') tells
  308. GDB to set a breakpoint on the source line point is on.
  309.  
  310.    If you accidentally delete the source-display buffer, an easy way to
  311. get it back is to type the command `f' in the GDB buffer, to request a
  312. frame display; when you run under Emacs, this recreates the source
  313. buffer if necessary to show you the context of the current frame.
  314.  
  315.    The source files displayed in Emacs are in ordinary Emacs buffers
  316. which are visiting the source files in the usual way.  You can edit the
  317. files with these buffers if you wish; but keep in mind that GDB
  318. communicates with Emacs in terms of line numbers.  If you add or delete
  319. lines from the text, the line numbers that GDB knows cease to
  320. correspond properly with the code.
  321.  
  322. 
  323. File: gdb.info,  Node: GDB Bugs,  Next: Command Line Editing,  Prev: Emacs,  Up: Top
  324.  
  325. Reporting Bugs in GDB
  326. *********************
  327.  
  328.    Your bug reports play an essential role in making GDB reliable.
  329.  
  330.    Reporting a bug may help you by bringing a solution to your problem,
  331. or it may not.  But in any case the principal function of a bug report
  332. is to help the entire community by making the next version of GDB work
  333. better.  Bug reports are your contribution to the maintenance of GDB.
  334.  
  335.    In order for a bug report to serve its purpose, you must include the
  336. information that enables us to fix the bug.
  337.  
  338. * Menu:
  339.  
  340. * Bug Criteria::                Have you found a bug?
  341. * Bug Reporting::               How to report bugs
  342.  
  343. 
  344. File: gdb.info,  Node: Bug Criteria,  Next: Bug Reporting,  Up: GDB Bugs
  345.  
  346. Have you found a bug?
  347. =====================
  348.  
  349.    If you are not sure whether you have found a bug, here are some
  350. guidelines:
  351.  
  352.    * If the debugger gets a fatal signal, for any input whatever, that
  353.      is a GDB bug.  Reliable debuggers never crash.
  354.  
  355.    * If GDB produces an error message for valid input, that is a bug.
  356.  
  357.    * If GDB does not produce an error message for invalid input, that
  358.      is a bug.  However, you should note that your idea of "invalid
  359.      input" might be our idea of "an extension" or "support for
  360.      traditional practice".
  361.  
  362.    * If you are an experienced user of debugging tools, your suggestions
  363.      for improvement of GDB are welcome in any case.
  364.  
  365. 
  366. File: gdb.info,  Node: Bug Reporting,  Prev: Bug Criteria,  Up: GDB Bugs
  367.  
  368. How to report bugs
  369. ==================
  370.  
  371.    A number of companies and individuals offer support for GNU products.
  372. If you obtained GDB from a support organization, we recommend you
  373. contact that organization first.
  374.  
  375.    You can find contact information for many support companies and
  376. individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
  377.  
  378.    In any event, we also recommend that you send bug reports for GDB to
  379. one of these addresses:
  380.  
  381.      bug-gdb@prep.ai.mit.edu
  382.      {ucbvax|mit-eddie|uunet}!prep.ai.mit.edu!bug-gdb
  383.  
  384.    *Do not send bug reports to `info-gdb', or to `help-gdb', or to any
  385. newsgroups.* Most users of GDB do not want to receive bug reports.
  386. Those that do, have arranged to receive `bug-gdb'.
  387.  
  388.    The mailing list `bug-gdb' has a newsgroup `gnu.gdb.bug' which
  389. serves as a repeater.  The mailing list and the newsgroup carry exactly
  390. the same messages.  Often people think of posting bug reports to the
  391. newsgroup instead of mailing them.  This appears to work, but it has one
  392. problem which can be crucial: a newsgroup posting often lacks a mail
  393. path back to the sender.  Thus, if we need to ask for more information,
  394. we may be unable to reach you.  For this reason, it is better to send
  395. bug reports to the mailing list.
  396.  
  397.    As a last resort, send bug reports on paper to:
  398.  
  399.      GNU Debugger Bugs
  400.      Free Software Foundation
  401.      545 Tech Square
  402.      Cambridge, MA 02139
  403.  
  404.    The fundamental principle of reporting bugs usefully is this:
  405. *report all the facts*.  If you are not sure whether to state a fact or
  406. leave it out, state it!
  407.  
  408.    Often people omit facts because they think they know what causes the
  409. problem and assume that some details do not matter.  Thus, you might
  410. assume that the name of the variable you use in an example does not
  411. matter.  Well, probably it does not, but one cannot be sure.  Perhaps
  412. the bug is a stray memory reference which happens to fetch from the
  413. location where that name is stored in memory; perhaps, if the name were
  414. different, the contents of that location would fool the debugger into
  415. doing the right thing despite the bug.  Play it safe and give a
  416. specific, complete example.  That is the easiest thing for you to do,
  417. and the most helpful.
  418.  
  419.    Keep in mind that the purpose of a bug report is to enable us to fix
  420. the bug if it is new to us.  It is not as important as what happens if
  421. the bug is already known.  Therefore, always write your bug reports on
  422. the assumption that the bug has not been reported previously.
  423.  
  424.    Sometimes people give a few sketchy facts and ask, "Does this ring a
  425. bell?"  Those bug reports are useless, and we urge everyone to *refuse
  426. to respond to them* except to chide the sender to report bugs properly.
  427.  
  428.    To enable us to fix the bug, you should include all these things:
  429.  
  430.    * The version of GDB.  GDB announces it if you start with no
  431.      arguments; you can also print it at any time using `show version'.
  432.  
  433.      Without this, we will not know whether there is any point in
  434.      looking for the bug in the current version of GDB.
  435.  
  436.    * The type of machine you are using, and the operating system name
  437.      and version number.
  438.  
  439.    * What compiler (and its version) was used to compile GDB--e.g.
  440.      "gcc-2.0".
  441.  
  442.    * What compiler (and its version) was used to compile the program you
  443.      are debugging--e.g.  "gcc-2.0".
  444.  
  445.    * The command arguments you gave the compiler to compile your
  446.      example and observe the bug.  For example, did you use `-O'?  To
  447.      guarantee you will not omit something important, list them all.  A
  448.      copy of the Makefile (or the output from make) is sufficient.
  449.  
  450.      If we were to try to guess the arguments, we would probably guess
  451.      wrong and then we might not encounter the bug.
  452.  
  453.    * A complete input script, and all necessary source files, that will
  454.      reproduce the bug.
  455.  
  456.    * A description of what behavior you observe that you believe is
  457.      incorrect.  For example, "It gets a fatal signal."
  458.  
  459.      Of course, if the bug is that GDB gets a fatal signal, then we will
  460.      certainly notice it.  But if the bug is incorrect output, we might
  461.      not notice unless it is glaringly wrong.  We are human, after all.
  462.      You might as well not give us a chance to make a mistake.
  463.  
  464.      Even if the problem you experience is a fatal signal, you should
  465.      still say so explicitly.  Suppose something strange is going on,
  466.      such as, your copy of GDB is out of synch, or you have encountered
  467.      a bug in the C library on your system.  (This has happened!)  Your
  468.      copy might crash and ours would not.  If you told us to expect a
  469.      crash, then when ours fails to crash, we would know that the bug
  470.      was not happening for us.  If you had not told us to expect a
  471.      crash, then we would not be able to draw any conclusion from our
  472.      observations.
  473.  
  474.    * If you wish to suggest changes to the GDB source, send us context
  475.      diffs.  If you even discuss something in the GDB source, refer to
  476.      it by context, not by line number.
  477.  
  478.      The line numbers in our development sources will not match those
  479.      in your sources.  Your line numbers would convey no useful
  480.      information to us.
  481.  
  482.    Here are some things that are not necessary:
  483.  
  484.    * A description of the envelope of the bug.
  485.  
  486.      Often people who encounter a bug spend a lot of time investigating
  487.      which changes to the input file will make the bug go away and which
  488.      changes will not affect it.
  489.  
  490.      This is often time consuming and not very useful, because the way
  491.      we will find the bug is by running a single example under the
  492.      debugger with breakpoints, not by pure deduction from a series of
  493.      examples.  We recommend that you save your time for something else.
  494.  
  495.      Of course, if you can find a simpler example to report *instead*
  496.      of the original one, that is a convenience for us.  Errors in the
  497.      output will be easier to spot, running under the debugger will take
  498.      less time, and so on.
  499.  
  500.      However, simplification is not vital; if you do not want to do
  501.      this, report the bug anyway and send us the entire test case you
  502.      used.
  503.  
  504.    * A patch for the bug.
  505.  
  506.      A patch for the bug does help us if it is a good one.  But do not
  507.      omit the necessary information, such as the test case, on the
  508.      assumption that a patch is all we need.  We might see problems
  509.      with your patch and decide to fix the problem another way, or we
  510.      might not understand it at all.
  511.  
  512.      Sometimes with a program as complicated as GDB it is very hard to
  513.      construct an example that will make the program follow a certain
  514.      path through the code.  If you do not send us the example, we will
  515.      not be able to construct one, so we will not be able to verify
  516.      that the bug is fixed.
  517.  
  518.      And if we cannot understand what bug you are trying to fix, or why
  519.      your patch should be an improvement, we will not install it.  A
  520.      test case will help us to understand.
  521.  
  522.    * A guess about what the bug is or what it depends on.
  523.  
  524.      Such guesses are usually wrong.  Even we cannot guess right about
  525.      such things without first using the debugger to find the facts.
  526.  
  527. 
  528. File: gdb.info,  Node: Command Line Editing,  Next: Using History Interactively,  Prev: GDB Bugs,  Up: Top
  529.  
  530. Command Line Editing
  531. ********************
  532.  
  533.    This text describes GNU's command line editing interface.
  534.  
  535. * Menu:
  536.  
  537. * Introduction and Notation::    Notation used in this text.
  538. * Readline Interaction::    The minimum set of commands for editing a line.
  539. * Readline Init File::        Customizing Readline from a user's view.
  540.  
  541. 
  542. File: gdb.info,  Node: Introduction and Notation,  Next: Readline Interaction,  Up: Command Line Editing
  543.  
  544. Introduction to Line Editing
  545. ============================
  546.  
  547.    The following paragraphs describe the notation we use to represent
  548. keystrokes.
  549.  
  550.    The text C-k is read as `Control-K' and describes the character
  551. produced when the Control key is depressed and the k key is struck.
  552.  
  553.    The text M-k is read as `Meta-K' and describes the character
  554. produced when the meta key (if you have one) is depressed, and the k
  555. key is struck.  If you do not have a meta key, the identical keystroke
  556. can be generated by typing ESC first, and then typing k.  Either
  557. process is known as "metafying" the k key.
  558.  
  559.    The text M-C-k is read as `Meta-Control-k' and describes the
  560. character produced by "metafying" C-k.
  561.  
  562.    In addition, several keys have their own names.  Specifically, DEL,
  563. ESC, LFD, SPC, RET, and TAB all stand for themselves when seen in this
  564. text, or in an init file (*note Readline Init File::., for more info).
  565.  
  566. 
  567. File: gdb.info,  Node: Readline Interaction,  Next: Readline Init File,  Prev: Introduction and Notation,  Up: Command Line Editing
  568.  
  569. Readline Interaction
  570. ====================
  571.  
  572.    Often during an interactive session you type in a long line of text,
  573. only to notice that the first word on the line is misspelled.  The
  574. Readline library gives you a set of commands for manipulating the text
  575. as you type it in, allowing you to just fix your typo, and not forcing
  576. you to retype the majority of the line.  Using these editing commands,
  577. you move the cursor to the place that needs correction, and delete or
  578. insert the text of the corrections.  Then, when you are satisfied with
  579. the line, you simply press RETURN.  You do not have to be at the end of
  580. the line to press RETURN; the entire line is accepted regardless of the
  581. location of the cursor within the line.
  582.  
  583. * Menu:
  584.  
  585. * Readline Bare Essentials::    The least you need to know about Readline.
  586. * Readline Movement Commands::    Moving about the input line.
  587. * Readline Killing Commands::    How to delete text, and how to get it back!
  588. * Readline Arguments::        Giving numeric arguments to commands.
  589.  
  590. 
  591. File: gdb.info,  Node: Readline Bare Essentials,  Next: Readline Movement Commands,  Up: Readline Interaction
  592.  
  593. Readline Bare Essentials
  594. ------------------------
  595.  
  596.    In order to enter characters into the line, simply type them.  The
  597. typed character appears where the cursor was, and then the cursor moves
  598. one space to the right.  If you mistype a character, you can use DEL to
  599. back up, and delete the mistyped character.
  600.  
  601.    Sometimes you may miss typing a character that you wanted to type,
  602. and not notice your error until you have typed several other
  603. characters.  In that case, you can type C-b to move the cursor to the
  604. left, and then correct your mistake.  Aftwerwards, you can move the
  605. cursor to the right with C-f.
  606.  
  607.    When you add text in the middle of a line, you will notice that
  608. characters to the right of the cursor get `pushed over' to make room
  609. for the text that you have inserted.  Likewise, when you delete text
  610. behind the cursor, characters to the right of the cursor get `pulled
  611. back' to fill in the blank space created by the removal of the text.  A
  612. list of the basic bare essentials for editing the text of an input line
  613. follows.
  614.  
  615. C-b
  616.      Move back one character.
  617.  
  618. C-f
  619.      Move forward one character.
  620.  
  621. DEL
  622.      Delete the character to the left of the cursor.
  623.  
  624. C-d
  625.      Delete the character underneath the cursor.
  626.  
  627. Printing characters
  628.      Insert itself into the line at the cursor.
  629.  
  630. C-_
  631.      Undo the last thing that you did.  You can undo all the way back
  632.      to an empty line.
  633.  
  634. 
  635. File: gdb.info,  Node: Readline Movement Commands,  Next: Readline Killing Commands,  Prev: Readline Bare Essentials,  Up: Readline Interaction
  636.  
  637. Readline Movement Commands
  638. --------------------------
  639.  
  640.    The above table describes the most basic possible keystrokes that
  641. you need in order to do editing of the input line.  For your
  642. convenience, many other commands have been added in addition to C-b,
  643. C-f, C-d, and DEL.  Here are some commands for moving more rapidly
  644. about the line.
  645.  
  646. C-a
  647.      Move to the start of the line.
  648.  
  649. C-e
  650.      Move to the end of the line.
  651.  
  652. M-f
  653.      Move forward a word.
  654.  
  655. M-b
  656.      Move backward a word.
  657.  
  658. C-l
  659.      Clear the screen, reprinting the current line at the top.
  660.  
  661.    Notice how C-f moves forward a character, while M-f moves forward a
  662. word.  It is a loose convention that control keystrokes operate on
  663. characters while meta keystrokes operate on words.
  664.  
  665. 
  666. File: gdb.info,  Node: Readline Killing Commands,  Next: Readline Arguments,  Prev: Readline Movement Commands,  Up: Readline Interaction
  667.  
  668. Readline Killing Commands
  669. -------------------------
  670.  
  671.    "Killing" text means to delete the text from the line, but to save
  672. it away for later use, usually by "yanking" it back into the line.  If
  673. the description for a command says that it `kills' text, then you can
  674. be sure that you can get the text back in a different (or the same)
  675. place later.
  676.  
  677.    Here is the list of commands for killing text.
  678.  
  679. C-k
  680.      Kill the text from the current cursor position to the end of the
  681.      line.
  682.  
  683. M-d
  684.      Kill from the cursor to the end of the current word, or if between
  685.      words, to the end of the next word.
  686.  
  687. M-DEL
  688.      Kill from the cursor to the start of the previous word, or if
  689.      between words, to the start of the previous word.
  690.  
  691. C-w
  692.      Kill from the cursor to the previous whitespace.  This is
  693.      different than M-DEL because the word boundaries differ.
  694.  
  695.    And, here is how to "yank" the text back into the line.  Yanking is
  696.  
  697. C-y
  698.      Yank the most recently killed text back into the buffer at the
  699.      cursor.
  700.  
  701. M-y
  702.      Rotate the kill-ring, and yank the new top.  You can only do this
  703.      if the prior command is C-y or M-y.
  704.  
  705.    When you use a kill command, the text is saved in a "kill-ring".
  706. Any number of consecutive kills save all of the killed text together, so
  707. that when you yank it back, you get it in one clean sweep.  The kill
  708. ring is not line specific; the text that you killed on a previously
  709. typed line is available to be yanked back later, when you are typing
  710. another line.
  711.  
  712. 
  713. File: gdb.info,  Node: Readline Arguments,  Prev: Readline Killing Commands,  Up: Readline Interaction
  714.  
  715. Readline Arguments
  716. ------------------
  717.  
  718.    You can pass numeric arguments to Readline commands.  Sometimes the
  719. argument acts as a repeat count, other times it is the sign of the
  720. argument that is significant.  If you pass a negative argument to a
  721. command which normally acts in a forward direction, that command will
  722. act in a backward direction.  For example, to kill text back to the
  723. start of the line, you might type M- C-k.
  724.  
  725.    The general way to pass numeric arguments to a command is to type
  726. meta digits before the command.  If the first `digit' you type is a
  727. minus sign (-), then the sign of the argument will be negative.  Once
  728. you have typed one meta digit to get the argument started, you can type
  729. the remainder of the digits, and then the command.  For example, to give
  730. the C-d command an argument of 10, you could type M-1 0 C-d.
  731.  
  732. 
  733. File: gdb.info,  Node: Readline Init File,  Prev: Readline Interaction,  Up: Command Line Editing
  734.  
  735. Readline Init File
  736. ==================
  737.  
  738.    Although the Readline library comes with a set of Emacs-like
  739. keybindings, it is possible that you would like to use a different set
  740. of keybindings.  You can customize programs that use Readline by putting
  741. commands in an "init" file in your home directory.  The name of this
  742. file is `~/.inputrc'.
  743.  
  744.    When a program which uses the Readline library starts up, the
  745. `~/.inputrc' file is read, and the keybindings are set.
  746.  
  747.    In addition, the C-x C-r command re-reads this init file, thus
  748. incorporating any changes that you might have made to it.
  749.  
  750. * Menu:
  751.  
  752. * Readline Init Syntax::    Syntax for the commands in `~/.inputrc'.
  753. * Readline Vi Mode::        Switching to `vi' mode in Readline.
  754.  
  755. 
  756. File: gdb.info,  Node: Readline Init Syntax,  Next: Readline Vi Mode,  Up: Readline Init File
  757.  
  758. Readline Init Syntax
  759. --------------------
  760.  
  761.    There are only four constructs allowed in the `~/.inputrc' file:
  762.  
  763. Variable Settings
  764.      You can change the state of a few variables in Readline.  You do
  765.      this by using the `set' command within the init file.  Here is how
  766.      you would specify that you wish to use Vi line editing commands:
  767.  
  768.           set editing-mode vi
  769.  
  770.      Right now, there are only a few variables which can be set; so few
  771.      in fact, that we just iterate them here:
  772.  
  773.     `editing-mode'
  774.           The `editing-mode' variable controls which editing mode you
  775.           are using.  By default, GNU Readline starts up in Emacs
  776.           editing mode, where the keystrokes are most similar to Emacs.
  777.           This variable can either be set to `emacs' or `vi'.
  778.  
  779.     `horizontal-scroll-mode'
  780.           This variable can either be set to `On' or `Off'.  Setting it
  781.           to `On' means that the text of the lines that you edit will
  782.           scroll horizontally on a single screen line when they are
  783.           larger than the width of the screen, instead of wrapping onto
  784.           a new screen line.  By default, this variable is set to `Off'.
  785.  
  786.     `mark-modified-lines'
  787.           This variable when set to `On', says to display an asterisk
  788.           (`*') at the starts of history lines which have been modified.
  789.           This variable is off by default.
  790.  
  791.     `prefer-visible-bell'
  792.           If this variable is set to `On' it means to use a visible
  793.           bell if one is available, rather than simply ringing the
  794.           terminal bell.  By default, the value is `Off'.
  795.  
  796. Key Bindings
  797.      The syntax for controlling keybindings in the `~/.inputrc' file is
  798.      simple.  First you have to know the name of the command that you
  799.      want to change.  The following pages contain tables of the command
  800.      name, the default keybinding, and a short description of what the
  801.      command does.
  802.  
  803.      Once you know the name of the command, simply place the name of
  804.      the key you wish to bind the command to, a colon, and then the
  805.      name of the command on a line in the `~/.inputrc' file.  The name
  806.      of the key can be expressed in different ways, depending on which
  807.      is most comfortable for you.
  808.  
  809.     KEYNAME: FUNCTION-NAME or MACRO
  810.           KEYNAME is the name of a key spelled out in English.  For
  811.           example:
  812.                Control-u: universal-argument
  813.                Meta-Rubout: backward-kill-word
  814.                Control-o: ">&output"
  815.  
  816.           In the above example, C-u is bound to the function
  817.           `universal-argument', and C-o is bound to run the macro
  818.           expressed on the right hand side (that is, to insert the text
  819.           `>&output' into the line).
  820.  
  821.     "KEYSEQ": FUNCTION-NAME or MACRO
  822.           KEYSEQ differs from KEYNAME above in that strings denoting an
  823.           entire key sequence can be specified.  Simply place the key
  824.           sequence in double quotes.  GNU Emacs style key escapes can
  825.           be used, as in the following example:
  826.  
  827.                "\C-u": universal-argument
  828.                "\C-x\C-r": re-read-init-file
  829.                "\e[11~": "Function Key 1"
  830.  
  831.           In the above example, C-u is bound to the function
  832.           `universal-argument' (just as it was in the first example),
  833.           C-x C-r is bound to the function `re-read-init-file', and ESC
  834.           [ 1 1 ~ is bound to insert the text `Function Key 1'.
  835.  
  836. * Menu:
  837.  
  838. * Commands For Moving::        Moving about the line.
  839. * Commands For History::    Getting at previous lines.
  840. * Commands For Text::        Commands for changing text.
  841. * Commands For Killing::    Commands for killing and yanking.
  842. * Numeric Arguments::        Specifying numeric arguments, repeat counts.
  843. * Commands For Completion::    Getting Readline to do the typing for you.
  844. * Miscellaneous Commands::    Other miscillaneous commands.
  845.  
  846. 
  847. File: gdb.info,  Node: Commands For Moving,  Next: Commands For History,  Up: Readline Init Syntax
  848.  
  849. Commands For Moving
  850. -------------------
  851.  
  852. `beginning-of-line (C-a)'
  853.      Move to the start of the current line.
  854.  
  855. `end-of-line (C-e)'
  856.      Move to the end of the line.
  857.  
  858. `forward-char (C-f)'
  859.      Move forward a character.
  860.  
  861. `backward-char (C-b)'
  862.      Move back a character.
  863.  
  864. `forward-word (M-f)'
  865.      Move forward to the end of the next word.
  866.  
  867. `backward-word (M-b)'
  868.      Move back to the start of this, or the previous, word.
  869.  
  870. `clear-screen (C-l)'
  871.      Clear the screen leaving the current line at the top of the screen.
  872.  
  873. 
  874. File: gdb.info,  Node: Commands For History,  Next: Commands For Text,  Prev: Commands For Moving,  Up: Readline Init Syntax
  875.  
  876. Commands For Manipulating The History
  877. -------------------------------------
  878.  
  879. `accept-line (Newline, Return)'
  880.      Accept the line regardless of where the cursor is.  If this line is
  881.      non-empty, add it to the history list.  If this line was a history
  882.      line, then restore the history line to its original state.
  883.  
  884. `previous-history (C-p)'
  885.      Move `up' through the history list.
  886.  
  887. `next-history (C-n)'
  888.      Move `down' through the history list.
  889.  
  890. `beginning-of-history (M-<)'
  891.      Move to the first line in the history.
  892.  
  893. `end-of-history (M->)'
  894.      Move to the end of the input history, i.e., the line you are
  895.      entering!
  896.  
  897. `reverse-search-history (C-r)'
  898.      Search backward starting at the current line and moving `up'
  899.      through the history as necessary.  This is an incremental search.
  900.  
  901. `forward-search-history (C-s)'
  902.      Search forward starting at the current line and moving `down'
  903.      through the the history as necessary.
  904.  
  905. 
  906. File: gdb.info,  Node: Commands For Text,  Next: Commands For Killing,  Prev: Commands For History,  Up: Readline Init Syntax
  907.  
  908. Commands For Changing Text
  909. --------------------------
  910.  
  911. `delete-char (C-d)'
  912.      Delete the character under the cursor.  If the cursor is at the
  913.      beginning of the line, and there are no characters in the line, and
  914.      the last character typed was not C-d, then return EOF.
  915.  
  916. `backward-delete-char (Rubout)'
  917.      Delete the character behind the cursor.  A numeric arg says to kill
  918.      the characters instead of deleting them.
  919.  
  920. `quoted-insert (C-q, C-v)'
  921.      Add the next character that you type to the line verbatim.  This is
  922.      how to insert things like C-q for example.
  923.  
  924. `tab-insert (M-TAB)'
  925.      Insert a tab character.
  926.  
  927. `self-insert (a, b, A, 1, !, ...)'
  928.      Insert yourself.
  929.  
  930. `transpose-chars (C-t)'
  931.      Drag the character before point forward over the character at
  932.      point.  Point moves forward as well.  If point is at the end of
  933.      the line, then transpose the two characters before point.
  934.      Negative args don't work.
  935.  
  936. `transpose-words (M-t)'
  937.      Drag the word behind the cursor past the word in front of the
  938.      cursor moving the cursor over that word as well.
  939.  
  940. `upcase-word (M-u)'
  941.      Uppercase all letters in the current (or following) word.  With a
  942.      negative argument, do the previous word, but do not move point.
  943.  
  944. `downcase-word (M-l)'
  945.      Lowercase all letters in the current (or following) word.  With a
  946.      negative argument, do the previous word, but do not move point.
  947.  
  948. `capitalize-word (M-c)'
  949.      Uppercase the first letter in the current (or following) word.
  950.      With a negative argument, do the previous word, but do not move
  951.      point.
  952.  
  953. 
  954. File: gdb.info,  Node: Commands For Killing,  Next: Numeric Arguments,  Prev: Commands For Text,  Up: Readline Init Syntax
  955.  
  956. Killing And Yanking
  957. -------------------
  958.  
  959. `kill-line (C-k)'
  960.      Kill the text from the current cursor position to the end of the
  961.      line.
  962.  
  963. `backward-kill-line ()'
  964.      Kill backward to the beginning of the line.  This is normally
  965.      unbound.
  966.  
  967. `kill-word (M-d)'
  968.      Kill from the cursor to the end of the current word, or if between
  969.      words, to the end of the next word.
  970.  
  971. `backward-kill-word (M-DEL)'
  972.      Kill the word behind the cursor.
  973.  
  974. `unix-line-discard (C-u)'
  975.      Do what C-u used to do in Unix line input.  We save the killed
  976.      text on the kill-ring, though.
  977.  
  978. `unix-word-rubout (C-w)'
  979.      Do what C-w used to do in Unix line input.  The killed text is
  980.      saved on the kill-ring.  This is different than backward-kill-word
  981.      because the word boundaries differ.
  982.  
  983. `yank (C-y)'
  984.      Yank the top of the kill ring into the buffer at point.
  985.  
  986. `yank-pop (M-y)'
  987.      Rotate the kill-ring, and yank the new top.  You can only do this
  988.      if the prior command is yank or yank-pop.
  989.  
  990. 
  991. File: gdb.info,  Node: Numeric Arguments,  Next: Commands For Completion,  Prev: Commands For Killing,  Up: Readline Init Syntax
  992.  
  993. Specifying Numeric Arguments
  994. ----------------------------
  995.  
  996. `digit-argument (M-0, M-1, ... M--)'
  997.      Add this digit to the argument already accumulating, or start a new
  998.      argument.  M- starts a negative argument.
  999.  
  1000. `universal-argument ()'
  1001.      Do what C-u does in emacs.  By default, this is not bound.
  1002.  
  1003. 
  1004. File: gdb.info,  Node: Commands For Completion,  Next: Miscellaneous Commands,  Prev: Numeric Arguments,  Up: Readline Init Syntax
  1005.  
  1006. Letting Readline Type For You
  1007. -----------------------------
  1008.  
  1009. `complete (TAB)'
  1010.      Attempt to do completion on the text before point.  This is
  1011.      implementation defined.  Generally, if you are typing a filename
  1012.      argument, you can do filename completion; if you are typing a
  1013.      command, you can do command completion, if you are typing in a
  1014.      symbol to GDB, you can do symbol name completion, if you are
  1015.      typing in a variable to Bash, you can do variable name
  1016.      completion...
  1017.  
  1018. `possible-completions (M-?)'
  1019.      List the possible completions of the text before point.
  1020.  
  1021. 
  1022. File: gdb.info,  Node: Miscellaneous Commands,  Prev: Commands For Completion,  Up: Readline Init Syntax
  1023.  
  1024. Some Miscellaneous Commands
  1025. ---------------------------
  1026.  
  1027. `re-read-init-file (C-x C-r)'
  1028.      Read in the contents of your `~/.inputrc' file, and incorporate
  1029.      any bindings found there.
  1030.  
  1031. `abort (C-g)'
  1032.      Stop running the current editing command.
  1033.  
  1034. `prefix-meta (ESC)'
  1035.      Make the next character that you type be metafied.  This is for
  1036.      people without a meta key.  Typing ESC f is equivalent to typing
  1037.      M-f.
  1038.  
  1039. `undo (C-_)'
  1040.      Incremental undo, separately remembered for each line.
  1041.  
  1042. `revert-line (M-r)'
  1043.      Undo all changes made to this line.  This is like typing the `undo'
  1044.      command enough times to get back to the beginning.
  1045.  
  1046. 
  1047. File: gdb.info,  Node: Readline Vi Mode,  Prev: Readline Init Syntax,  Up: Readline Init File
  1048.  
  1049. Readline Vi Mode
  1050. ----------------
  1051.  
  1052.    While the Readline library does not have a full set of Vi editing
  1053. functions, it does contain enough to allow simple editing of the line.
  1054.  
  1055.    In order to switch interactively between Emacs and Vi editing modes,
  1056. use the command M-C-j (toggle-editing-mode).
  1057.  
  1058.    When you enter a line in Vi mode, you are already placed in
  1059. `insertion' mode, as if you had typed an `i'.  Pressing ESC switches
  1060. you into `edit' mode, where you can edit the text of the line with the
  1061. standard Vi movement keys, move to previous history lines with `k', and
  1062. following lines with `j', and so forth.
  1063.  
  1064. 
  1065. File: gdb.info,  Node: Using History Interactively,  Next: Renamed Commands,  Prev: Command Line Editing,  Up: Top
  1066.  
  1067. Using History Interactively
  1068. ***************************
  1069.  
  1070.    This chapter describes how to use the GNU History Library
  1071. interactively, from a user's standpoint.
  1072.  
  1073. * Menu:
  1074.  
  1075. * History Interaction::        What it feels like using History as a user.
  1076.  
  1077. 
  1078. File: gdb.info,  Node: History Interaction,  Up: Using History Interactively
  1079.  
  1080. History Interaction
  1081. ===================
  1082.  
  1083.    The History library provides a history expansion feature that is
  1084. similar to the history expansion in Csh.  The following text describes
  1085. the sytax that you use to manipulate the history information.
  1086.  
  1087.    History expansion takes place in two parts.  The first is to
  1088. determine which line from the previous history should be used during
  1089. substitution.  The second is to select portions of that line for
  1090. inclusion into the current one.  The line selected from the previous
  1091. history is called the "event", and the portions of that line that are
  1092. acted upon are called "words".  The line is broken into words in the
  1093. same fashion that the Bash shell does, so that several English (or
  1094. Unix) words surrounded by quotes are considered as one word.
  1095.  
  1096. * Menu:
  1097.  
  1098. * Event Designators::    How to specify which history line to use.
  1099. * Word Designators::    Specifying which words are of interest.
  1100. * Modifiers::        Modifying the results of susbstitution.
  1101.  
  1102. 
  1103. File: gdb.info,  Node: Event Designators,  Next: Word Designators,  Up: History Interaction
  1104.  
  1105. Event Designators
  1106. -----------------
  1107.  
  1108.    An event designator is a reference to a command line entry in the
  1109. history list.
  1110.  
  1111. `!'
  1112.      Start a history subsititution, except when followed by a space,
  1113.      tab, or the end of the line... = or (.
  1114.  
  1115. `!!'
  1116.      Refer to the previous command.  This is a synonym for `!-1'.
  1117.  
  1118. `!n'
  1119.      Refer to command line N.
  1120.  
  1121. `!-n'
  1122.      Refer to the command line N lines back.
  1123.  
  1124. `!string'
  1125.      Refer to the most recent command starting with STRING.
  1126.  
  1127. `!?string'[`?']
  1128.      Refer to the most recent command containing STRING.
  1129.  
  1130. 
  1131. File: gdb.info,  Node: Word Designators,  Next: Modifiers,  Prev: Event Designators,  Up: History Interaction
  1132.  
  1133. Word Designators
  1134. ----------------
  1135.  
  1136.    A : separates the event specification from the word designator.  It
  1137. can be omitted if the word designator begins with a ^, $, * or %.
  1138. Words are numbered from the beginning of the line, with the first word
  1139. being denoted by a 0 (zero).
  1140.  
  1141. `0 (zero)'
  1142.      The zero'th word.  For many applications, this is the command word.
  1143.  
  1144. `n'
  1145.      The N'th word.
  1146.  
  1147. `^'
  1148.      The first argument.  that is, word 1.
  1149.  
  1150. `$'
  1151.      The last argument.
  1152.  
  1153. `%'
  1154.      The word matched by the most recent `?string?' search.
  1155.  
  1156. `x-y'
  1157.      A range of words; `-Y' Abbreviates `0-Y'.
  1158.  
  1159. `*'
  1160.      All of the words, excepting the zero'th.  This is a synonym for
  1161.      `1-$'.  It is not an error to use * if there is just one word in
  1162.      the event.  The empty string is returned in that case.
  1163.  
  1164. 
  1165. File: gdb.info,  Node: Modifiers,  Prev: Word Designators,  Up: History Interaction
  1166.  
  1167. Modifiers
  1168. ---------
  1169.  
  1170.    After the optional word designator, you can add a sequence of one or
  1171. more of the following modifiers, each preceded by a :.
  1172.  
  1173. `#'
  1174.      The entire command line typed so far.  This means the current
  1175.      command, not the previous command, so it really isn't a word
  1176.      designator, and doesn't belong in this section.
  1177.  
  1178. `h'
  1179.      Remove a trailing pathname component, leaving only the head.
  1180.  
  1181. `r'
  1182.      Remove a trailing suffix of the form `.'SUFFIX, leaving the
  1183.      basename.
  1184.  
  1185. `e'
  1186.      Remove all but the suffix.
  1187.  
  1188. `t'
  1189.      Remove all leading  pathname  components, leaving the tail.
  1190.  
  1191. `p'
  1192.      Print the new command but do not execute it.
  1193.  
  1194. 
  1195. File: gdb.info,  Node: Renamed Commands,  Next: Formatting Documentation,  Prev: Using History Interactively,  Up: Top
  1196.  
  1197. Renamed Commands
  1198. ****************
  1199.  
  1200.    The following commands were renamed in GDB 4, in order to make the
  1201. command set as a whole more consistent and easier to use and remember:
  1202.  
  1203.      OLD COMMAND               NEW COMMAND
  1204.      ---------------           -------------------------------
  1205.      add-syms                  add-symbol-file
  1206.      delete environment        unset environment
  1207.      info convenience          show convenience
  1208.      info copying              show copying
  1209.      info directories          show directories
  1210.      info editing              show commands
  1211.      info history              show values
  1212.      info targets              help target
  1213.      info values               show values
  1214.      info version              show version
  1215.      info warranty             show warranty
  1216.      set/show addressprint     set/show print address
  1217.      set/show array-max        set/show print elements
  1218.      set/show arrayprint       set/show print array
  1219.      set/show asm-demangle     set/show print asm-demangle
  1220.      set/show caution          set/show confirm
  1221.      set/show demangle         set/show print demangle
  1222.      set/show history write    set/show history save
  1223.      set/show prettyprint      set/show print pretty
  1224.      set/show screen-height    set/show height
  1225.      set/show screen-width     set/show width
  1226.      set/show sevenbit-strings set/show print sevenbit-strings
  1227.      set/show unionprint       set/show print union
  1228.      set/show vtblprint        set/show print vtbl
  1229.      
  1230.      unset                     [No longer an alias for delete]
  1231.  
  1232. 
  1233. File: gdb.info,  Node: Formatting Documentation,  Next: Installing GDB,  Prev: Renamed Commands,  Up: Top
  1234.  
  1235. Formatting Documentation
  1236. ************************
  1237.  
  1238.    The GDB 4 release includes an already-formatted reference card, ready
  1239. for printing with PostScript or GhostScript, in the `gdb' subdirectory
  1240. of the main source directory(1).  If you can use PostScript or
  1241. GhostScript with your printer, you can print the reference card
  1242. immediately with `refcard.ps'.
  1243.  
  1244.    The release also includes the source for the reference card.  You
  1245. can format it, using TeX, by typing:
  1246.  
  1247.      make refcard.dvi
  1248.  
  1249.    The GDB reference card is designed to print in landscape mode on US
  1250. "letter" size paper; that is, on a sheet 11 inches wide by 8.5 inches
  1251. high.  You will need to specify this form of printing as an option to
  1252. your DVI output program.
  1253.  
  1254.    All the documentation for GDB comes as part of the machine-readable
  1255. distribution.  The documentation is written in Texinfo format, which is
  1256. a documentation system that uses a single source file to produce both
  1257. on-line information and a printed manual.  You can use one of the Info
  1258. formatting commands to create the on-line version of the documentation
  1259. and TeX (or `texi2roff') to typeset the printed version.
  1260.  
  1261.    GDB includes an already formatted copy of the on-line Info version of
  1262. this manual in the `gdb' subdirectory.  The main Info file is
  1263. `gdb-VERSION-NUMBER/gdb/gdb.info', and it refers to subordinate files
  1264. matching `gdb.info*' in the same directory.  If necessary, you can
  1265. print out these files, or read them with any editor; but they are
  1266. easier to read using the `info' subsystem in GNU Emacs or the
  1267. standalone `info' program, available as part of the GNU Texinfo
  1268. distribution.
  1269.  
  1270.    If you want to format these Info files yourself, you need one of the
  1271. Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'.
  1272.  
  1273.    If you have `makeinfo' installed, and are in the top level GDB
  1274. source directory (`gdb-4.12', in the case of version 4.12), you can
  1275. make the Info file by typing:
  1276.  
  1277.      cd gdb
  1278.      make gdb.info
  1279.  
  1280.    If you want to typeset and print copies of this manual, you need TeX,
  1281. a program to print its DVI output files, and `texinfo.tex', the Texinfo
  1282. definitions file.
  1283.  
  1284.    TeX is a typesetting program; it does not print files directly, but
  1285. produces output files called DVI files.  To print a typeset document,
  1286. you need a program to print DVI files.  If your system has TeX
  1287. installed, chances are it has such a program.  The precise command to
  1288. use depends on your system; `lpr -d' is common; another (for PostScript
  1289. devices) is `dvips'.  The DVI print command may require a file name
  1290. without any extension or a `.dvi' extension.
  1291.  
  1292.    TeX also requires a macro definitions file called `texinfo.tex'.
  1293. This file tells TeX how to typeset a document written in Texinfo
  1294. format.  On its own, TeX cannot read, much less typeset a Texinfo file.
  1295. `texinfo.tex' is distributed with GDB and is located in the
  1296. `gdb-VERSION-NUMBER/texinfo' directory.
  1297.  
  1298.    If you have TeX and a DVI printer program installed, you can typeset
  1299. and print this manual.  First switch to the the `gdb' subdirectory of
  1300. the main source directory (for example, to `gdb-4.12/gdb') and then
  1301. type:
  1302.  
  1303.      make gdb.dvi
  1304.  
  1305.    ---------- Footnotes ----------
  1306.  
  1307.    (1)  In `gdb-4.12/gdb/refcard.ps' of the version 4.12 release.
  1308.  
  1309.